﻿<Window x:Class="Big2.Big2WfpGui.Big2Room"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:My="clr-namespace:Big2.Big2WfpGui"
    Title="Big2Room" Height="700" Width="950" Loaded="Window_Loaded" Closing="Window_Closing">
      
    <Window.Resources>
        <DataTemplate x:Key="itemsTemplate">
            <TextBlock HorizontalAlignment="Center"
                     Margin="0,0,0,0"
                     VerticalAlignment="Center"
                     FontSize="12"
                     FontWeight="Bold"
                     Foreground="Red" 
                     Text="{Binding Message}" />
         </DataTemplate>
        <DataTemplate x:Key="currentPlayItemsTemplate" >
                <Image Source="{Binding ImageFilename}" Width="72" Height="96"></Image>
        </DataTemplate>
        <ItemsPanelTemplate x:Key="currentPlayItemsPanelTemplate">
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"></StackPanel>
        </ItemsPanelTemplate>
        
   </Window.Resources>
    
    
    <Grid>
        <DockPanel Height="700" Width="950" Margin="0,0,0,0" Name="dockPanel1">
            <StackPanel Name="stackTop" Margin="0,0,0,0" Height="40" VerticalAlignment="Top" DockPanel.Dock="Top">
                <TextBlock Text="Big2" Background="AliceBlue"></TextBlock>
            </StackPanel>
            <StackPanel Name="stackRight" Margin="0" Width="200" DockPanel.Dock="Right" Background="DarkGray"></StackPanel>
            <StackPanel Name="stackBottom" Margin="0" Height="200" Width="950" DockPanel.Dock="Bottom" Background="Beige">
                <TextBlock Text="Chat Box" Background="AliceBlue" VerticalAlignment="Top" Height="20"></TextBlock>
                <Grid Name="Grid3" Width="800" Height="180" Background="Green" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="400"></ColumnDefinition>
                        <ColumnDefinition Width="125"></ColumnDefinition>    
                        <ColumnDefinition Width="275"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="100"></RowDefinition>
                        <RowDefinition Height="80"></RowDefinition>
                    </Grid.RowDefinitions>                   
                    <TextBox Name="tbTalkHistory" IsReadOnly="True" Width="390" HorizontalAlignment="Left" Margin="5,5,5,5" Grid.Column="0" Grid.Row="0" VerticalScrollBarVisibility="Auto" />
                    <Grid x:Name="gridChatRow" Width="400" Height="50" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="5,0,5,0" Grid.Column="0" Grid.Row="1">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="300" />
                            <ColumnDefinition Width="100" />
                        </Grid.ColumnDefinitions>
                        <TextBox Height="25" Name="tbTalk" Width="300" Grid.Column="0"  />
                        <Button Height="25" Name="btTalk" Width="100" Grid.Column="1" HorizontalAlignment="Right" Click="btTalk_Click">Talk</Button>
                    </Grid>
                    <StackPanel Name="StackPanel4" Grid.Column="1" Grid.RowSpan="2" Margin="20,5,0,0" HorizontalAlignment="Left" Height="125" Width="100" VerticalAlignment="Top">
                        <TextBlock Text="Players" Width="100" Background="Cornsilk" HorizontalAlignment="Left"></TextBlock>
                        <ListBox  HorizontalAlignment="Left" Name="lbUsers" Height="125" Width="100" VerticalAlignment="Top" >                            
                            <ItemsControl
                                ItemsSource="{Binding ElementName=Big2Room, Path=playersAndChattersCollection}"
                                ItemTemplate="{StaticResource itemsTemplate}" >   
                                
                            </ItemsControl>

                        </ListBox>
                    </StackPanel>
                    <StackPanel Name="StackPanel5" Grid.Column="2" Grid.RowSpan="2" Margin="0,5,0,0" HorizontalAlignment="Left" Height="125" Width="220" VerticalAlignment="Top">
                        <TextBox Name="tbSystemMSG" Width="200" Height="125"  Background="Cornsilk" Foreground="Red" Cursor="Arrow" IsEnabled="True" Focusable="False" IsTabStop="False" HorizontalAlignment="Center" IsReadOnly="True" TextDecorations="None" IsUndoEnabled="True" TextWrapping="Wrap" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"></TextBox>
                    </StackPanel>

                </Grid>
                
                
                                  
                                
            </StackPanel>

            
            <StackPanel Name="stackMain" Margin="0"  Width="750" Height="460" DockPanel.Dock="Left" Background="Aqua">
                <DockPanel Width="750" Margin="0,0,0,0" Name="dpPlayArea" Height="460" LastChildFill="True">
                    
                    <Canvas Name="canvasSeat4" DockPanel.Dock="Left" Width="120" Height="350" Background="Green" VerticalAlignment="Center"></Canvas>
                    <Canvas Name="canvasSeat2" DockPanel.Dock="Right" Width="120" Height="350" Background="Green" VerticalAlignment="Center" HorizontalAlignment="Center">                        
                        
                    </Canvas>
                    
                    <Canvas Name="canvasSeat3" Background="Green" DockPanel.Dock="Top" Width="350" Height="120" VerticalAlignment="Center">                        
                    </Canvas>                    
                    <Canvas Name="canvasSeat1" Background="Green" Width="350" DockPanel.Dock="Bottom" Height="120"  VerticalAlignment="Center" Margin="0">
                        
                    </Canvas>
                    <Canvas Name="canvasSeatCenter" Width="350" DockPanel.Dock="Bottom" Height="150" Background="Green" >
                        <ListView ItemsSource="{Binding}" Name="lbCurrentPlay" ItemTemplate="{StaticResource currentPlayItemsTemplate}" 
                                  HorizontalAlignment="Center" VerticalAlignment="Center"                               
                                  ItemsPanel="{StaticResource currentPlayItemsPanelTemplate}" >                            
                        </ListView>

                    </Canvas>                    
                </DockPanel>
               
            </StackPanel>
            
            
        </DockPanel>
        <Button Name="btJoinGame" Margin="341.375,252,0,0" Height="32.98" HorizontalAlignment="Left" VerticalAlignment="Top" Width="89.625" Click="btJoinGame_Click">Join Game</Button>
        <Canvas Name="canvasButtons" Width="184" Height="50" Background="Transparent" DockPanel.Dock="Right" HorizontalAlignment="Right" Margin="0,0,193,162" VerticalAlignment="Bottom">
            <Button Name="btPlay" Width="75" Height="22" Canvas.Left="10" Canvas.Top="17" Click="btPlay_Click">Play</Button>
            <Button Name="btPass" Width="75" Height="22" Canvas.Left="96" Canvas.Top="18" Click="btPass_Click">Pass</Button>
        </Canvas>
        <Rectangle x:Name="rectangle1" Width="950" Height="700" Fill="PaleTurquoise" Opacity="0.5"></Rectangle>
        <My:Login x:Name="LoginControl" Opacity="0" ></My:Login>
        <My:PlayerScores x:Name="UserScores" Opacity="100" Visibility="Hidden"></My:PlayerScores>
        
       </Grid>
    
</Window>
